package cn.itsource.ymcc.feign;

import cn.itsource.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaSearchFeignFallbackFactory implements FallbackFactory<MediaSearchFeign> {

    @Override
    public MediaSearchFeign create(Throwable throwable) {
        return new MediaSearchFeign() {
            @Override
            public JSONResult getByCourseId(Long id) {
                throwable.printStackTrace();
                return JSONResult.error("feigh错误，降级");
            }
        };
    }
}
